<div id="main_wrap">
	<div class="center_wrap clearfix">
        <h2 class="no_bottom no_top breadcrumb">
        	<a href="{$baseurl}/categories/">view playlist</a> 
        </h2>

		<div id="sidebar_wrap">
  			<div id="list_cats">
			<a class="category-txt" href="{$baseurl}/categories/">
	<img alt="Category" src="{$baseurl}/images/tjj_music_we_categories.jpg">
        </a>
    			<ul id="ul_categories">
                	{insert name=get_audio_categories assign=listaudiocategories}
        			{section name=o loop=$listaudiocategories}
                    {if $smarty.request.filter eq $listaudiocategories[o].CATID}
                    <li><b>{$listaudiocategories[o].name|stripslashes}</b></li>
                    {else}
	    			<li><a href="{$baseurl}/browse/categories/audios/z/{$listaudiocategories[o].CATID}/1/{$listaudiocategories[o].name|stripslashes}">{$listaudiocategories[o].name|stripslashes}</a></li>
                    {/if}
        			{/section}
                </ul>
  			</div>
  			<div class="sky_ad">
            	<center>
            	{insert name=get_advertisement value=var AID="2"}
                </center>
            </div>
		</div>
        
		<div class="right col1" style="margin:0px;">
            <div class="cat_box_full clearfix" id="browse_main"> 
			
            	{*<!--
				## commented for integration on 3 march 2012
				<p class="right results">{if $error eq ""}{$beginning} - {$ending} {$lang61} {$total} {$lang796}{/if}</p>
                <ul id="search_nav" class="clearfix">
                    <li class="current">{$showtitle}<span></span></li>
                </ul>-->*}
				<table width="100%" cellspacing="3" cellpadding="3" border="0">
					<tr>
						<td valign="top">
							<h2>{$playlist[0].playlist_title}</h2>
						</td>
                    </tr>
					{if $deleteMsg neq ""}
						<tr>
							<td>
								<div id="smsg" class="errorPage clearfix" style="">
									<h2 style="font-size:18px">{$deleteMsg}</h2>
								</div>
							</td>
						</tr>
					{/if}	
				</table>
                <div class="cat_body_full clearfix">
                  <!-- LOOP START -->
                  
                {if $error ne ""}
                {include file="show_error.tpl"}
                {/if}
                {if $showmessage ne ""}
                {include file="show_message.tpl"}
                {/if}
				{if $error eq ""} 
                  <div>
      				<span id="player"> We recently encoded our videos in a newer Flash format. You need to 
                        <br />
                        get the latest <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> to see this video.
                    </span>
						
					{*
					 ** Create the jwplayer from here... **
					*}	
					 
					 <script type="text/javascript">
						var s1 = new SWFObject("{$baseurl}/player.swf","flvplayer","450","450","7");
						s1.addParam("allowfullscreen","true");
						/*s1.addVariable("width","500");
						s1.addVariable("height","300");
						s1.addVariable("displayheight","300");*/
						s1.addVariable("file","{$baseurl}/playlists/{$playlistID}.xml");
						s1.addVariable("autostart","true");
						s1.addVariable("autoplay","true");
						s1.addVariable("autoplay","on");
						s1.addVariable("screencolor","#FFFFFF");
						s1.addVariable("playlist","bottom");
						s1.addVariable("repeat","list");
						s1.addVariable("playlist.size","100");
						s1.write("player");
					</script> 
    			</div>
				{/if}
				<div id="browse_results">
				{if $userID neq '0' && $playlist[0].USERID eq $userID}
				<form method="POST" action="{$baseurl}/view_playlist.php?ID={$playlistID}" onsubmit="return chkAudios();">
				{/if}
					<ul>
						{section name=i loop=$listaudios}
							<li class="video">
								<div class="video_i">
									<a href="{$baseurl}/audios/{$listaudios[i].AUDIOID}/{insert name=get_seotitle_from_audioid assign=title audioid=$listaudios[i].AUDIOID}">
										{*<img class="imag" height="87" width="116" alt="{$listaudios[i].title|stripslashes}" src="{$athumburl}/{$listaudios[i].AUDIOID}-1{$listaudios[i].ext}" />*}
										{capture assign='player'}images/audiothumbs/{$listaudios[i].AUDIOID}-1{$listaudios[i].ext}{/capture} 
                                        {if $player|file_exists}
                                            <img class="imag" height="87" width="116" alt="{$listaudios[i].title|stripslashes}" src="{$athumburl}/{$listaudios[i].AUDIOID}-1{$listaudios[i].ext}" />
                                        {else}
                                            <img class="imag" height="87" width="116" alt="{$listaudios[i].title|stripslashes}" src="{$athumburl}/default.png" />
                                        {/if}
										<div class="tag"></div>
									</a>
									<a href="{$baseurl}/audios/{$listaudios[i].AUDIOID}/{insert name=get_seotitle_from_audioid assign=title audioid=$listaudios[i].AUDIOID}">
										<span class="artist_name">
											{if $listaudios[i].artist|stripslashes eq ""}
												Anonymous
											{else}
                                                                                            {$listaudios[i].artist|stripslashes|truncate:15:"...":true} 
											{/if}
											</span>
										<span class="song_name">{$listaudios[i].title|stripslashes|truncate:15:"...":true}</span>
									</a>
									{if $userID neq '0' && $playlist[0].USERID eq $userID}
										<div>Remove <input type="checkbox" name="audio[]" value="{$listaudios[i].AUDIOID}" /></div>
									{/if}
									
								</div>
							</il>
						{/section}	
					</ul>
					{if $userID neq '0' && $playlist[0].USERID eq $userID && $error eq ''}
						<div class="clear"></div>
						<input type="Submit" value="Remove" name="remove" id="remove" />
						</form>
					{/if}
				</div> 
                  <!-- LOOP END -->
    
                </div>

                <div class="paginate">
                	{$pagelinks}
                    {*<!--<p class="left">{if $error eq ""}{$beginning} - {$ending} {$lang61} {$total} {$lang796}{/if}</p>-->*}
                </div>
  			</div>
		</div>
    	<div class="clear"></div>
	</div>
</div>
{literal}
<script type="text/javascript">
var $j = jQuery.noConflict();
	function chkAudios(){
	
		var atLeastOneIsChecked = jQuery('input[name="audio[]"]:checked').length;
		if(atLeastOneIsChecked<=0){
			alert("Please select atleast one audio to remove from the playlist.");
			return false;
		}
		else 
			return true;
	}
</script>
{/literal}